class User():
    """一个简单的user类"""

    def __init__(self, first_name, last_name, **intros):
        self.first_name = first_name
        self.last_name = last_name
        self.full_name = self.first_name + self.last_name
        self.intros = intros
        self.login_attempts = 1

    def increment_login_attempts(self):
        self.login_attempts += 1

    def reset_login_attempts(self):
        self.login_attempts = 0

    def describe_user(self):
        for self.key, self.value in self.intros.items():
            print("%s的%s是%s" % (self.full_name, self.key, self.value))
            #return self.key, self.value
        print("你好%s!" % self.full_name)


user = User('王', '旭', professioin='网络管理员', gender='male')
#user.describe_user()
user.describe_user()
user.increment_login_attempts()
user.increment_login_attempts()
user.increment_login_attempts()
user.increment_login_attempts()
user.increment_login_attempts()
print(user.login_attempts)
user.reset_login_attempts()
print(user.login_attempts)
#print(user.describe_user())
'''
    def describe_user(self):
        print("\nThe user's name is %s %s." % (self.first_name, self.last_name))
        print("The %s is %s." % (self.key, self.value))
'''
